cmake_minimum_required(VERSION 3.0)

project(SelfDebug)

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

include(SupportI386)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -std=c99 -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall")

include(FindLibDwarf)
include(FindLibUnwind)

option(BUILD_TEST "OFF by default, define as ON to build test." OFF)
option(BUILD_TEST_ONLY "OFF by default, define as ON to build test only." OFF)

if (NOT BUILD_TEST_ONLY)
	add_subdirectory(src)
endif ()
if (BUILD_TEST OR BUILD_TEST_ONLY)
	add_subdirectory(test)
endif ()
